package com.globant.AutomateEMR;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;


public class PropertyLoader {
	public String pathToLoader;
	private Properties configProp = new Properties();

	public Properties getConfigProp() {
		return configProp;
	}
	public void setConfigProp(Properties configProp) {
		this.configProp = configProp;
	}
	public PropertyLoader(String pathToLoader) {
		super();
		this.pathToLoader = pathToLoader;
	}
	public PropertyLoader() {
		super();
	}
	public void loadProps() {
		InputStream in = this.getClass().getResourceAsStream("/com/globant/resources/DbProperties");
		try {
			configProp.load(in);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	public String readProperty(String property) throws IOException{
		 	Properties prop = new Properties();
		    InputStream is = new FileInputStream(pathToLoader);
		    prop.load(is);
		    return prop.getProperty(property);
	}
	
}
